Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #81]Fix RocketMQTemplate.syncSend collection type method signature #150

Merged
merged 10 commits into from
Oct 31, 2019

Conversation

MartinDai
Copy link
Contributor

@MartinDai MartinDai commented Sep 24, 2019

What is the purpose of the change

fix RocketMQTemplate.syncSend collection type method signature

Verifying this change

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist.
  • Run mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

Sorry, something went wrong.

@RongtongJin
Copy link
Contributor

RongtongJin commented Sep 26, 2019

Hi @MartinDai, do you verified in your environment? I tried your pr, but still the syncSend(String destination, Object payload, long timeout) method was called.

@MartinDai
Copy link
Contributor Author

Hi @MartinDai, do you verified in your environment? I tried your pr, but still the syncSend(String destination, Object payload, long timeout) method was called.

I verified that it is ok.Can you provide your invoke this method's code segment?

@RongtongJin
Copy link
Contributor

Hi @MartinDai, do you verified in your environment? I tried your pr, but still the syncSend(String destination, Object payload, long timeout) method was called.

I verified that it is ok.Can you provide your invoke this method's code segment?

OKay, It's success now. So why not just change the method signature to SendResult syncSend(String destination, Collection<Message> messages, long timeout)?

@MartinDai
Copy link
Contributor Author

MartinDai commented Sep 26, 2019

Hi @MartinDai, do you verified in your environment? I tried your pr, but still the syncSend(String destination, Object payload, long timeout) method was called.

I verified that it is ok.Can you provide your invoke this method's code segment?

OKay, It's success now. So why not just change the method signature to SendResult syncSend(String destination, Collection<Message> messages, long timeout)?

Because SendResult syncSend(String destination, Collection<Message> messages, long timeout) means the messages's node type must be Message(exclude subClass or implementation class). if you use List<GenericMessage> msgList = new ArrayList<>(); to invoke the method, it will be call thesyncSend(String destination, Object payload, long timeout),even the classGenericMessage implement Message.

@RongtongJin
Copy link
Contributor

@MartinDai, Got it, LGTM~

@vongosling
Copy link
Member

@MartinDai It would be helpful to verify if you could add some test in your polish. I would like to follow up and help to merge this pr:-)

@MartinDai
Copy link
Contributor Author

@MartinDai It would be helpful to verify if you could add some test in your polish. I would like to follow up and help to merge this pr:-)

OK, I will add some test code soon.

remove duplicate OrderPaidEvent class;
add rocketmq-domain-demo module to make samples module code-style better;
@MartinDai
Copy link
Contributor Author

@vongosling I was committed some test code,but the Travis CI build failed. I don't understand the error detail, can you help to process?

@RongtongJin
Copy link
Contributor

@MartinDai The reason for the failure of Travis CI may be the lack of Apache license in your newly created file. But more importantly, you should write some unit tests instead of sample.

@MartinDai
Copy link
Contributor Author

@RongtongJin @vongosling I was added some unit test code,you can check it now.

@vongosling vongosling changed the title [ISSUE #81]fix RocketMQTemplate.syncSend collection type method signature [ISSUE #81]Fix RocketMQTemplate.syncSend collection type method signature Oct 28, 2019
@vongosling
Copy link
Member

@MartinDai Just add some unit test to verify your modification instead of making the code more complex :-(

@RongtongJin
Copy link
Contributor

@MartinDai Could you delete sample related code that you add ?We don't need a new sample.
In addition, the testBatchSendMessage test that you add is failed in unit test.

@MartinDai
Copy link
Contributor Author

@RongtongJin The unnecessary code was reverted, and the Travis CI build passed.It means the unit test was passed right?

@RongtongJin
Copy link
Contributor

Good job, and the unit test was passed, but even if choose the wrong type, it will also pass.
I think you can expect the exccption that only syncSend batch messages will throw.

@MartinDai
Copy link
Contributor Author

@RongtongJin I have changed the testBatchSendMessage unit test method.I think that is the best way for this🤣.

@RongtongJin
Copy link
Contributor

LGTM~

@duhenglucky
Copy link
Contributor

@MartinDai could you resolve the conflict first, and we will merge this PR ASAP.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@MartinDai
Copy link
Contributor Author

MartinDai commented Oct 31, 2019

@MartinDai could you resolve the conflict first, and we will merge this PR ASAP.

@duhenglucky Has done yet. You can merge now

@ShannonDing ShannonDing added the bug Something isn't working label Oct 31, 2019
@ShannonDing ShannonDing added this to the 2.0.4 milestone Oct 31, 2019
@ShannonDing ShannonDing merged commit e10cc5e into apache:master Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants